﻿<?php
/*
 * Created on Feb 3, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 	if (!headers_sent()){
		header('Content-type: text/html; charset=' . _('utf-8'));
	}
 	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
	echo '<html xmlns="http://www.w3.org/1999/xhtml">';
	echo '<head>';
	echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
	echo '<link rel="shortcut icon" href="../favicon.ico">';
	echo '<title>'.$title.'</title>';
	echo '<link rel="stylesheet" type="text/css" href="../css/theme.css" />';
	echo '<link rel="stylesheet" type="text/css" href="../css/style.css" />';
	echo '<script type="text/javascript" src="../js/calendar/datetimepicker.js"></script>';	
	if($_SESSION['CurrentHeader'] == 4){
		echo '<script type="text/javascript" src="../js/fckeditor/fckeditor.js"></script>';
	}
	echo '</head>';
	
	echo '<body>
	<div id="container">
    	<div id="header">
        	<img src="../img/house_admin.png" width="80" height="80" /><h2>Lộc Thịnh Real Estate Control Panel</h2>
    	<div id="topmenu">
            	<ul style="width: 958px">';
				if($_SESSION['CurrentHeader'] == 1)
                	echo '<li class="current"><a href="realestatetype.php">Loại BĐS</a></li>';
				else echo '<li><a href="realestatetype.php">Loại BĐS</a></li>';
				if($_SESSION['CurrentHeader'] == 2)
                	echo '<li class="current"><a href="transaction.php">Sàn giao địch</a></li>';
				else echo '<li><a href="transaction.php">Sàn giao địch</a></li>';
				if($_SESSION['CurrentHeader'] == 3)
                	echo '<li class="current"><a href="cityregion.php">Khu đô thị</a></li>';
				else echo '<li><a href="cityregion.php">Khu đô thị</a></li>';
				if($_SESSION['CurrentHeader'] == 8)
                	echo '<li class="current"><a href="managerees.php">Quản lí BĐS</a></li>';
				else echo '<li><a href="managerees.php">Quản lí BĐS</a></li>';
				if($_SESSION['CurrentHeader'] == 9)
                	echo '<li class="current"><a href="searchreess.php">Tìm kiếm BĐS</a></li>';
				else echo '<li><a href="searchreess.php">Tìm kiếm BĐS</a></li>';
				if($_SESSION['CurrentHeader'] == 4)
                	echo '<li class="current"><a href="info.php?SelectedIfd=1">Thông tin chung</a></li>';
				else echo '<li><a href="info.php?SelectedIfd=1">Thông tin chung</a></li>';
				if($_SESSION['CurrentHeader'] == 10)
                	echo '<li class="current"><a href="managecity.php">Cập nhật Tỉnh/TP</a></li>';
				else echo '<li><a href="managecity.php">Cập nhật Tỉnh/TP</a></li>';	
				if($_SESSION['CurrentHeader'] == 6)
                	echo '<li class="current"><a href="userinfo.php">Tài khoản</a></li>';
				else echo '<li><a href="userinfo.php">Tài khoản</a></li>';
				if($_SESSION['CurrentHeader'] == 7)
                	echo '<li class="current"><a href="setup.php">Thiết lập</a></li>';
				else echo '<li><a href="setup.php">Thiết lập</a></li>';		
				if($_SESSION['CurrentHeader'] == 5)
					echo '<li class="current"><a href="banner.php">Quảng cáo</a></li>';
				else echo '<li><a href="banner.php">Quảng cáo</a></li>';
				if($session->logged_in){
					echo '<li><a href="../controllers/userinfo_controller.php">Đăng xuất</a></li>';
				}
	echo '</ul>';
    echo '</div>';		
    echo '</div>';
     echo '<div id="top-panel">
            <div id="panel"><ul>';			
			echo '<li><a href="searchrees.php" class="search">Tìm kiếm bất động sản</a></li>';
			if($_SESSION['CurrentHeader'] == 1){
				
				echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID .'" class="all">Tất cả</a></li>';
				
				$categoryArray = $realestateModel->getCategory();
				while ($myrow = $realestateModel->getArrayTypes($categoryArray)) {
					echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . '&SelectedCategory='.$myrow[0].'" class="house">'.$myrow[1].'</a></li>';
				}
				echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID .'" class="add">Thêm...</a></li>';
			}
			
			if($_SESSION['CurrentHeader'] == 4){
				echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . '&SelectedIfd=1'.'" class="manage_page">Giới thiệu</a></li>';
				echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . '&SelectedIfd=2'.'" class="manage_page">Tin tức</a></li>';
				echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . '&SelectedIfd=3'.'" class="manage_page">Dịch vụ</a></li>';
				echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . '&SelectedIfd=4'.'" class="manage_page">Dự án</a></li>';				
			}
			if($_SESSION['CurrentHeader'] == 6){
				//echo '<li><a href="#" class="search">Tìm kiếm tài khoản</a></li>';
			}
	echo '
                </ul>			
            </div>
      </div>';
	  
	echo '<script type="text/javascript">';
	$todayDay = date('d');
	$todayMonth = date('m');
	$todayYear = date('Y');
	$today = $todayDay.'/'.$todayMonth.'/'.$todayYear;
 	
  	// init the array with the days of the month for every month
  	echo 'var days = new Array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );';
	echo "var MonthName = new Array();
	   MonthName[1-1] = 'January';
	   MonthName[2-1] = 'February';
	   MonthName[3-1] = 'March';
	   MonthName[4-1] = 'April';
	   MonthName[5-1] = 'May';
	   MonthName[6-1] = 'June';
	   MonthName[7-1] = 'July';
	   MonthName[8-1] = 'August';
	   MonthName[9-1] = 'September';
	   MonthName[10-1] = 'October';
	   MonthName[11-1] = 'November';
	   MonthName[12-1] = 'December';";
	 
	echo 'var WindowTitle = "Select Date";';
	echo '</script>';
?>